#include "../include/config.hpp"
#include <cassert>

using namespace easylog;

void test()
{
    config::instance().set_level(level::info);
    std::cout << level::level2str(config::instance().get_level()) << std::endl;

    config::instance().set_pattern("[%d{%F %H:%M:%S}][%p][%t][%c][%f:%l]%T%m%n");
    std::cout << config::instance().get_pattern() << std::endl;

    config::instance().set_colorful(true);
    std::cout << config::instance().get_oncolor() << std::endl;

    config::instance().set_color({
        { level::debug, color_enum::none         },
        { level::info,  color_enum::green        },
        { level::warn,  color_enum::yellow       },
        { level::error, color_enum::light_purple },
        { level::fatal, color_enum::red          },
    });

    std::cout << config::instance().get_color()[level::debug] << std::endl;
    std::cout << config::instance().get_color()[level:: info] << std::endl;
    std::cout << config::instance().get_color()[level:: warn] << std::endl;
    std::cout << config::instance().get_color()[level::error] << std::endl;
    std::cout << config::instance().get_color()[level::fatal] << std::endl;
}

#define TEST \
                1

int main()
{
    switch (TEST)
    {
        case 1: test();  break;
        // case 2: test(); break;
        default: assert(false);
    }

    return 0;
}
